]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
network: Use checkConnection to set up the initial connections
authorJasper St. Pierre <jstpierre@mecheye.net>
Fri, 26 Apr 2013 22:47:22 +0000 (18:47 -0400)
committerJasper St. Pierre <jstpierre@mecheye.net>
Wed, 15 May 2013 15:13:11 +0000 (11:13 -0400)
https://bugzilla.gnome.org/show_bug.cgi?id=700322

js/ui/status/network.js

index e449190242293a6fcbd8550588025984925a9ca8..aa0f30d914ee152b150422db64a3e2ca27f602b3 100644 (file)
@@ -180,22 +180,7 @@ const NMConnectionBased = new Lang.Class({
 
     _init: function(connections) {
         this._connections = [ ];
-        for (let i = 0; i < connections.length; i++) {
-            if (!connections[i].get_uuid())
-                continue;
-            if (!this.connectionValid(connections[i]))
-                continue;
-            // record the connection
-            let obj = {
-                connection: connections[i],
-                name: connections[i].get_id(),
-                uuid: connections[i].get_uuid(),
-                timestamp: connections[i]._timestamp,
-                item: null,
-            };
-            this._connections.push(obj);
-        }
-        this._connections.sort(this._connectionSortFunction);
+        connections.forEach(Lang.bind(this, this.checkConnection));
     },
 
     checkConnection: function(connection) {